var e = require("../../../@babel/runtime/helpers/interopRequireDefault"), a = e(require("../../../@babel/runtime/regenerator")), t = require("../../../@babel/runtime/helpers/toConsumableArray"), r = require("../../../@babel/runtime/helpers/asyncToGenerator"), s = e(require("../../../utils/api")), o = getApp();

Page({
    data: {
        statusBarHeight: o.globalData.statusBarHeight,
        headImg: "",
        nickName: "",
        companyName: "",
        score: "",
        tip: "下拉刷新更多内容",
        pageNum: 1,
        pageSize: 9,
        list: [],
        more: !0
    },
    getList: function() {
        var e = this;
        return r(a.default.mark(function r() {
            var o, i, n;
            return a.default.wrap(function(a) {
                for (;;) switch (a.prev = a.next) {
                  case 0:
                    return o = wx.getStorageSync("openid"), a.prev = 1, a.next = 4, s.default.record({
                        openid: o,
                        scoreTypes: "1,2,3,4,5,6",
                        pageNum: e.data.pageNum,
                        pageSize: e.data.pageSize
                    });

                  case 4:
                    i = a.sent, (n = e.data.list).push.apply(n, t(i.result.list)), e.setData({
                        list: n
                    }), i.result.list.length < e.data.pageSize && e.setData({
                        more: !1,
                        tip: "没有更多了"
                    }), a.next = 14;
                    break;

                  case 11:
                    a.prev = 11, a.t0 = a.catch(1), console.log(a.t0.msg);

                  case 14:
                  case "end":
                    return a.stop();
                }
            }, r, null, [ [ 1, 11 ] ]);
        }))();
    },
    onLoad: function(e) {
        console.log(1, o.globalData), this.setData({
            name: o.globalData.userInfo.name,
            headImg: o.globalData.userInfo.headImg,
            companyName: o.globalData.userInfo.companyName,
            score: Number(o.globalData.scoreboard)
        }), this.getList();
    },
    onReachBottom: function() {
        this.data.more && (this.setData({
            pageNum: ++this.data.pageNum
        }), this.getList());
    }
});